//Volunteer.h
#ifndef VOLUNTEER_H_
#define VOLUNTEER_H_
#include <string>
#include "ServiceType.h"
#include "ServiceTime.h"
#include <iostream>
#include <string>
#include <map>
using namespace std;
class Volunteer {
private:
    string name;
    string address;
    ServiceType serviceType;//通过枚举 ServiceType 表示
    ServiceTime serviceTime;//通过枚举 ServiceTime 表示
    static void f1() {}
public:
    Volunteer(string n = "未知", string a = "未知", ServiceType sType = Sanitation, ServiceTime sTime = Sunday) : name(n), address(a), serviceType(sType), serviceTime(sTime) {}

    Volunteer(const Volunteer& v) {
        if (this != &v) {
            name = v.name;
            address = v.address;
            serviceType = v.serviceType;
            serviceTime = v.serviceTime;
        }
    }

    ~Volunteer() {
        if (&name != nullptr) {
            delete &name;
        }
        if (&address != nullptr) {
            delete &address;
        }
    }


    void Work() {
        map<int, string> temp;
        temp.insert(pair<int, string>(0, "Monday"));
        temp.insert(pair<int, string>(1, "Tuesday"));
        temp.insert(pair<int, string>(2, "Wednesday"));
        temp.insert(pair<int, string>(3, "Thursday"));
        temp.insert(pair<int, string>(4, "Friday"));
        temp.insert(pair<int, string>(5, "Saturday"));
        temp.insert(pair<int, string>(6, "Sunday"));
        cout << "Providing ";
        if (serviceType == Publicity) {
            cout << "publicity on " << temp.at(serviceTime) << endl;
        } else if(serviceType == MedicalCare) {
            cout << "medical care on " << temp.at(serviceTime) << endl;
        } else if (serviceType == Security) {
            cout << "security on " << temp.at(serviceTime) << endl;
        } else if(serviceType == Sanitation) {
            cout << "sanitation on " << temp.at(serviceTime) << endl;
        }
    }

    ServiceType GetType() {
        return serviceType;
    }

    string GetAddress() {
        return address;
    }

    string GetName() {
        return name;
    }
};
#endif